//
//  YTDefaultProgressView.swift
//  YTImgeViewer
//
//  Created by aron on 2018/5/25.
//

import UIKit

class YTDefaultProgressView: UIView {
    
    private lazy var loadingIndicator: UIActivityIndicatorView = {
        let loadingIndicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.gray)
        return loadingIndicator
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        loadingIndicator.frame = self.bounds
    }
    
    private func setupUI() {
        addSubview(loadingIndicator)
    }
    
    func setProgress(progress: Float) {
        loadingIndicator.startAnimating()
    }
    
}
